package com.the_ring.structural.faced;

/**
 * @author: t22306139
 * @date: 2023/12/1  9:53
 */
public class Computer {

    private CPU cpu;
    private Disk disk;
    private Memory memory;

    public Computer() {
        this.cpu = new CPU();
        this.disk = new Disk();
        this.memory = new Memory();
    }

    public void start() {
        System.out.println("Computer start begin");
        cpu.start();
        disk.start();
        memory.start();
        System.out.println("Computer start end");
    }

    public void shutDown() {
        System.out.println("Computer shutDown begin");
        cpu.shutDown();
        disk.shutDown();
        memory.shutDown();
        System.out.println("Computer shutDown end");
    }

    public static class CPU {

        public void start() {
            System.out.println("CPU is start...");
        }

        public void shutDown() {
            System.out.println("CPU is shutDown...");
        }
    }

    public static class Disk {

        public void start() {
            System.out.println("Disk is start...");
        }

        public void shutDown() {
            System.out.println("Disk is shutDown...");
        }
    }

    public static class Memory {
        public void start() {
            System.out.println("Memory is start...");
        }

        public void shutDown() {
            System.out.println("Memory is shutDown...");
        }

    }
}
